package com.microtf.inscription.framework.vo.user;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.ArrayList;
import java.util.Collection;

/**
 * 用户登录后的对象
 * @see UserDetails
 * @author guliuzhong
 * @since 1.0
 */
@Getter
@Setter
public class UserLoginDto implements UserDetails {
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     * 大部分情况下为空
     */
    private String password;
    /**
     * 帐号过期
     */
    private boolean isAccountNonExpired;
    /**
     * 帐号锁定
     */
    private boolean isAccountNonLocked;
    /**
     * 无有效帐号
     * Indicates whether the user's credentials (password) has expired. Expired credentials prevent authentication.
     */
    private boolean isCredentialsNonExpired;
    /**
     * 帐号开启
     */
    private boolean isEnabled;
    /**
     * 用户ID
     */
    private Long userId;
    /**
     * 用户权限列表
     */
    Collection<? extends GrantedAuthority> authorities = new ArrayList<>();
}
